package edu.mis.modules.orderproductitem;

import java.util.List;

import com.jfinal.plugin.activerecord.Record;

import edu.mis.model.Orderproductitem;

public class OrderproductitemService {
	
	
	/**
	 * 查询订单明细记录
	 * @return
	 */
	public List<Record> findAllRecordWithName(){
		return Orderproductitem.dao.findAllRecord();
	}
	
	/**
	 * 根据订单编号删除订单明细记录
	 * @param orderproductNumber
	 * @return
	 */
	public boolean deleteOrderproductitemByOrderproductNumber(int orderproductNumber) {
		boolean result = true;
		while(result = true) {
			Orderproductitem orderproductitem = Orderproductitem.dao.findOrderproductitemByOrderproductNumber(orderproductNumber);
			if(orderproductitem==null) {
				result=false;
				break;
			}
			orderproductitem.delete();
		}
		return result;
	}
	
}
